using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       PosLogicTransferSender.cs
*@brief      send message PosLogicTransfer
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/22
*/

//send message PosLogicTransfer
public class msgPosLogicTransfer
{
    public const int MessageId = (int)NetMessageTypes.MessageType.PosLogicTransfer;
    //TODO
    public int SessionId = NetLib.INVALID_SESSION;
    public poslogictransfer.PosLogicTrasfer TransferMsg = new poslogictransfer.PosLogicTrasfer();
    /// <summary>
    /// Initializes a new instance of the <see cref="msgGameLogicTransfer"/> class.
    /// </summary>
    /// <param name='session_id'>
    /// Session_id.
    /// </param>
    /// <param name='sub_id'>
    /// Sub_id.
    /// </param>
    /// <param name='buffer'>
    /// Buffer.
    /// </param>
    public msgPosLogicTransfer(int session_id, int world_id, byte[] logic_main)
    {
        SessionId = session_id;
        TransferMsg.WorldId = world_id;
        TransferMsg.Buffer = logic_main;
    }
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of PosLogicTransfer</param>
    public static void ProcessMessage(msgPosLogicTransfer msg)
    {
        //TODO
        ProtoNet<poslogictransfer.PosLogicTrasfer>.Send(msg.SessionId, (uint)msgPosLogicTransfer.MessageId, msg.TransferMsg);
    }
}
